import { IntersectionType, OmitType, PartialType } from '@nestjs/swagger'
import { IsOptional, IsString } from 'class-validator'
import { ListPaginationDto } from '@/shared/types/globalDto.dto'
import { Subscribe } from '../entities/subscribe.entity'

export class CreateSubscribeDto {
  /**
   * 预约人的 uid
   */
  @IsString()
  userUid: string

  /**
   * 邀请人的 uid
   */
  @IsOptional()
  @IsString()
  inviteUserUid?: string
}
export class WebCreateSubscribeDto {
  /**
   * 邀请人的 uid
   */
  @IsOptional()
  @IsString()
  inviteUserUid?: string
}
export class UpdateSubscribeDto extends CreateSubscribeDto {}
export class FindSubscribeDto extends PartialType(OmitType(Subscribe, ['subscribeUserInfo', 'inviteUserInfo'])) {}

export class ListPageSubscribeDto extends PartialType(IntersectionType(FindSubscribeDto, ListPaginationDto)) {}
export class ListPageSubscribeVo {
  total: number
  list: Subscribe[]
}
